-
Notifications
You must be signed in to change notification settings - Fork 677
[nrf fromlist] GRTC optimizations #2740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The following west manifest projects have changed revision in this Pull Request:
✅ All manifest checks OK Note: This message is automatically posted and updated by the Manifest GitHub Action. |
0d72e4d
to
9c533ef
Compare
813d1ec
to
c01b11c
Compare
0a523b9
to
a9d803b
Compare
ec5b435
to
3ca0b86
Compare
3ca0b86
to
d11f72e
Compare
👏👏👏 |
bca3794
to
1172c56
Compare
3f659e2
to
4552b8f
Compare
a104b59
to
094ca6f
Compare
|
094ca6f
to
331765f
Compare
drivers/timer/nrf_grtc_timer.c
Outdated
@@ -428,22 +432,15 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) | |||
} | |||
#endif /* CONFIG_POWEROFF */ | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could be redundant
a620088
to
31374c8
Compare
… initialization" This reverts commit de4fad1. Signed-off-by: Krzysztof Chruściński <[email protected]>
…ization The GRTC counter is not cleared at startup, therefore the `last_count` variable needs to be initialized accordingly. This change: - Prevents overflow of the `sys_clock_announce()` int32_t parameter - Ensures the correct uptime value, which should be reset during initialization Signed-off-by: Adam Kondraciuk <[email protected]> (cherry picked from commit e77f942cff5516140f7db48bb42eda49522c1c7a)
…ister access Speed up execution of the interrupt handler and sys_clock_set_timeout(). Sys_clock_set_timeout() can be called in two scenarios: from previous timeout expiration handler or freely. If the former case fast path can be used since CC value in the GRTC register just expired and it can be used as a reference for CCADD setting. This is only a single register write so it's much faster. In the latter a longer procedure is applied which also happens in two variants. If value which is set in CC is further in the future (e.g. K_FOREVER was set before) then CC can be safely overwritten with a new value without a risk of triggering unexpected COMPARE event. If value in CC is earlier than the new CC value (if earlier timeout was aborted) then there is a risk of COMPARE event happening while it is being overwritten. That case requires long and safer procedure of setting CC. Update hal_nordic with changes in the nrfx_grtc driver which are needed for nrf_grtc_timer changes. Upstream PR #: 87944 Signed-off-by: Krzysztof Chruściński <[email protected]>
Add stress test that randomly starts and aborts multiple timers from various contexts. Test checks if timers do not expire prematurely. Upstream PR #: 87944 Signed-off-by: Krzysztof Chruściński <[email protected]>
20870c6
to
b3bbeb5
Compare
Changes in GRTC system clock driver that reduce time spend in GRTC calls by approx. 50%.
PR created to run NCS CI on that change.